

int* addToArrayForm(int* num, int numSize, int k, int* returnSize) {
    int n = 0;
    for (int i = 0; i < numSize; i++)
    {
        n = n * 10 + num[i];
    }
    int ret = n + k;
    int flag = ret;
    int len = 0;
    while (flag)
    {
        len++;
        flag /= 10;
    }
    int* result = (int*)malloc(sizeof(int) * len);
    int i = len - 1;
    while (ret)
    {
        result[i--] = ret % 10;
        ret /= 10;
    }
    *returnSize = len;
    return result;
}